package rad.framework.mda.generator.template.main.webapp.webinf;

import rad.framework.mda.generator.util.*;

public class JsfComponents
{
  protected static String nl;
  public static synchronized JsfComponents create(String lineSeparator)
  {
    nl = lineSeparator;
    JsfComponents result = new JsfComponents();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL + "<components xmlns=\"http://jboss.com/products/seam/components\"" + NL + "\txmlns:core=\"http://jboss.com/products/seam/core\"" + NL + "\txmlns:ui=\"http://jboss.com/products/seam/ui\"" + NL + "\txmlns:menu=\"http://framework.rad/portal/menu\"" + NL + "\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" + NL + "\txsi:schemaLocation=\"http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd" + NL + "\t\t\t\thttp://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd\">" + NL + "   " + NL + "\t<component name=\"";
  protected final String TEXT_2 = ".bundles\" class=\"rad.framework.seam.ext.BundleNames\" " + NL + "\t\tbundleNames=\"";
  protected final String TEXT_3 = "-rules,";
  protected final String TEXT_4 = "-application,";
  protected final String TEXT_5 = "-messages\" />" + NL + "" + NL + "\t<ui:jpa-entity-loader name=\"";
  protected final String TEXT_6 = "EntityLoader\" " + NL + "\t\tentity-manager=\"#{";
  protected final String TEXT_7 = "EntityManager}\" />" + NL + "\t<ui:entity-converter name=\"";
  protected final String TEXT_8 = "EntityManagerEntityConverter\" " + NL + "\t\tentity-loader=\"#{";
  protected final String TEXT_9 = "EntityLoader}\" />" + NL + "" + NL + "\t<menu:menu-init name=\"A";
  protected final String TEXT_10 = "Menu\"" + NL + "\t\tlabel=\"#{messages['";
  protected final String TEXT_11 = "_Menu']}\"" + NL + "\t\tsortOrder=\"10\"" + NL + "\t\trendered=\"#{s:hasRole('User')}\"" + NL + "\t/>" + NL + "" + NL + "</components>" + NL;
  protected final String TEXT_12 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    

    org.eclipse.uml2.uml.Model uml2Model = (org.eclipse.uml2.uml.Model) argument;
    stringBuffer.append(TEXT_1);
    stringBuffer.append(NameHelper.uncapSafeName(uml2Model).replace("-","."));
    stringBuffer.append(TEXT_2);
    stringBuffer.append(NameHelper.uncapSafeName(uml2Model));
    stringBuffer.append(TEXT_3);
    stringBuffer.append(NameHelper.uncapSafeName(uml2Model));
    stringBuffer.append(TEXT_4);
    stringBuffer.append(NameHelper.uncapSafeName(uml2Model));
    stringBuffer.append(TEXT_5);
    stringBuffer.append(NameHelper.uncapSafeName(uml2Model).replace("-",""));
    stringBuffer.append(TEXT_6);
    stringBuffer.append(NameHelper.uncapSafeName(uml2Model).replace("-",""));
    stringBuffer.append(TEXT_7);
    stringBuffer.append(NameHelper.uncapSafeName(uml2Model).replace("-",""));
    stringBuffer.append(TEXT_8);
    stringBuffer.append(NameHelper.uncapSafeName(uml2Model).replace("-",""));
    stringBuffer.append(TEXT_9);
    stringBuffer.append(NameHelper.getCapName(uml2Model).replace("-","_"));
    stringBuffer.append(TEXT_10);
    stringBuffer.append(NameHelper.getCapName(uml2Model).replace("-","_"));
    stringBuffer.append(TEXT_11);
    stringBuffer.append(TEXT_12);
    return stringBuffer.toString();
  }
}
